package easydst;
import java.io.File;
import java.io.Serializable;

import exception.ComponentException;


public class Component implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String accessPoint;
	private String classpath;
	private File componentFile;
	

	//To serialize TODO
	public Component(){
		 
	}
	
	public Component(String componentFilePath, String accessPoint, String classpath) throws ComponentException{
		this.accessPoint = accessPoint;
		this.classpath = classpath;
		componentFile = new File(componentFilePath);
		if (!componentFile.exists()){
			throw new ComponentException("The file " + componentFilePath + " does not exist.");
		}
	}
	
	public Component(String componentFilePath, String accessPoint) throws ComponentException{
		new Component(componentFilePath, accessPoint, "");
	}
	
	public String getAccessPoint() {
		return accessPoint;
	}

	public void setAccessPoint(String accessPoint) {
		this.accessPoint = accessPoint;
	}

	public String getClasspath() {
		return classpath;
	}

	public void setClasspath(String classpath) {
		this.classpath = classpath;
	}
	
}
